		
/* ************************************************************************************* 
 * CREATED BY:          MYGENERATION
 * CREATED DATE:        2/7/2009
 * PROJECT:             MCWEBSITE
 * PURPOSE:             LinkTypeBUL class
 * MODIFIED BY:         None
 * MODIFIED DATE:       None
 * MODIFIED REASON:     None
 * NOTES:               None
 **************************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using MCWEBSITE.DAL;
using MCWEBSITE.ENTITY;

namespace MCWEBSITE.BUL
{
    public class LinkTypeBUL
    {
        public static int Save(LinkTypeInfo _LinkTypeInfo)
        {
            try
            {
                if (_LinkTypeInfo.LinkTypeId == 0)
                {
                    return LinkTypeDAL.Insert(_LinkTypeInfo);
                }
                else
                {
                    return LinkTypeDAL.Update(_LinkTypeInfo);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on insert theme : {0}", ex.Message));
            }
        }

        public static int Remove(int _LinkTypeId)
        {
            try
            {
                return LinkTypeDAL.Delete(_LinkTypeId);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on delete Theme : {0}", ex.Message));
            }
        }

        public static List<LinkTypeInfo> GetAll()
        {
            try
            {
                return LinkTypeDAL.SelectAll();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static LinkTypeInfo Load(int _LinkTypeId)
        {
            try
            {
                return LinkTypeDAL.SelectOne(_LinkTypeId);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static List<LinkTypeInfo> Search()
        {
            try
            {
                return LinkTypeDAL.SelectFilters();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }
    }
}

		